package com.five.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageResult<T> {
    private Long totalCount;//总记录数
    private Integer pageSize;//每页显示记录数
    private Integer totalPage;//总页数
    private Integer pageNum;//当前页码
    private List<T> dataList;

    public void setTotalPage() {
        this.totalPage = (int) Math.ceil((double) totalCount / pageSize);
    }
}
